package nju.mscs.data.object;

import java.io.Serializable;

public class GoodsDiscountPromotion extends Promotion implements DiscountPromotion, GoodsPromotion ,Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -1995358345526557541L;
	private Goods goods;
	private double discount;
	GoodsDiscountPromotion(String id, Goods goods,double discount,Date begin,Date over) {
		super(id, Promotion.GoodsDiscountPromotion,begin,over);
		this.goods = goods;
		this.discount = discount;
	}
	@Override
	public boolean check(Goods goods) {
		return goods.getId().equals(this.goods.getId());
	}
	@Override
	public double getDiscount() {
		return discount;
	}
	@Override
	public Goods getGoods() {
		// TODO Auto-generated method stub
		return goods;
	}
}
